package com.rightsidetech.http.controller.agentAdmin.system;

import com.rightsidetech.commom.base.ResponseData;
import com.rightsidetech.http.aspect.Log;
import com.rightsidetech.http.aspect.Token;
import com.rightsidetech.http.base.BaseController;
import com.rightsidetech.system.service.SysAgentResourceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shenyu.client.springmvc.annotation.ShenyuSpringMvcClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: yhr
 * @Date: 2021-11-02 09:23
 */
@RestController
@RequestMapping("/agentAdmin/sys_agent_resource")
@ShenyuSpringMvcClient(path = "/agentAdmin/sys_agent_resource/**")
@Api(tags = "代理商后台菜单")
public class SysAgentAdminResourceController extends BaseController {
    @Resource
    private SysAgentResourceService sysAgentResourceService;

    @Log
    @Token
    @GetMapping("/getList")
    @ApiOperation("admin:查询当前账户的所有权限")
    public ResponseData getAllSysResource() throws Exception {
        Long loginInfoId = Long.parseLong(getAttribute());
        return sysAgentResourceService.getAllSysResource(loginInfoId);
    }
}
